package com.hundsun.cprs.yyt.service.excel.enums;

import java.util.HashMap;
import java.util.Map;

public enum EnumExcelRecordType {
    RECORD_TYPE("bidRecord","出价明细报表"),
    CLINCH_TYPE("clinchRecord","成交明细报表"),
    HANDLING_STATUS("1","正在处理中，请稍后..."),
    COMPLETED_STATUS("2","导出已完成");


    /** 状态值 */
    private String code;
    /** 状态值说明 */
    private String desc;

    private EnumExcelRecordType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 全局索引池
     */
    private static Map<String, EnumExcelRecordType> pool = new HashMap<String, EnumExcelRecordType>();
    static {
        for (EnumExcelRecordType et : EnumExcelRecordType.values()) {
            pool.put(et.code + "", et);
        }
    }

    /**
     * 根据内容索引
     *
     * @param code
     * @return
     */
    public static EnumExcelRecordType indexByValue(String code) {
        return pool.get(code);
    }

    public static Map<String, EnumExcelRecordType> toMap() {
        return pool;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
